Repository navigation
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-cloudflare-staging-cleanup-void-cloud.voidzero-docs.workers.dev (commit 3fe517d)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
cpojer
left a comment
There was a problem hiding this comment.
Woah, I ran into this a few times and could never repro. How did you find, repro and fix this?
cpojer
left a comment
There was a problem hiding this comment.
Two issues:
- If Cloudflare’s list catches up to Void’s staging deployment before it shows a newer rollback, the retry can send the candidate to 100%. After a failed status read, cleanup can instead send the previous version to 100%.
- A newer deployment can have the same live@100%, candidate@0% split as a previous one, but we should probably save the deployment ID returned by the staging write and require an exact match before activation/cleanup.
My agent suggested me don't answer this question becuase it'll show the fact I know nothing. (I'm asking agents to use Void like a real person and it catch it. |
Agent talk: It came from #895: davidgustys's report pinned the stop to the single status read right after staging. I reproduced it in unit tests with a fake Cloudflare whose status still shows the previous deployment for a few reads after the staging write. I couldn't make Cloudflare itself lag on demand. Both hold. Both are fixed, except one case that no read can rule out:
|
|
For #895, #927 is just an improvement rather a complete fix. I investigated and proposed a final solution under #895 (comment). |
A deploy that stages the new version at 0% can stop right before activation and leave that staging deployment behind.
Every later deploy is then refused with "The existing Worker must have one deployed version receiving all traffic".
Now the deploy waits for Cloudflare's status to catch up, and removes its own staging deployment when a fresh read still shows it.
Before:
After:
flowchart LR A["Stage previous@100, new@0"] --> B["Read status"] B -- "previous@100, new@0" --> F["Activate new@100"] B -- "same deployment as before staging" --> W["Wait, read again"] W --> B B -- "still lagging after the wait, or read failed" --> R{"Fresh read shows previous@100, new@0?"} R -- yes --> P["Redeploy previous@100, stop"] R -- no --> S["Stop, no write"] B -- "another deployment" --> SA status that still shows the deployment ID from before staging counts as lagging, not as another deploy.
The deploy rereads it for up to about 5.5 minutes, on the schedule from #892.
Stops before activation now say whether Void removed its staging deployment, instead of claiming that triggers were restored.
A traffic-split stop after the upload no longer says that no version was uploaded.
When the fresh read can't confirm the staging deployment is Void's own, it stays in place and the next deploy is still refused.
Recovering from that in the next deploy is the issue's third proposal, and isn't part of this PR.
Part of #895.